import React, { useState } from 'react';
import SvgIcon from '@/icons/SvgIcon';
import { Link } from 'react-router-dom'
// import axios from 'axios'


const Demo = () => {
  const [count, setCount] = useState(false)
  console.log({ count }, /* setCount */)
  // axios.get('/dveapi/posts').then((res) => {
  //   console.log('Demo', res)
  // })
  // var req = new Request(URL, {method: 'GET', cache: 'reload'})

  // https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch
  // fetch('/dveapi/posts')
  //   .then(function (response) {
  //     return response.json();
  //   })
  //   .then(function (myJson) {
  //     console.log('myJson', myJson);
  //   });

  return (<div>
    <SvgIcon iconName='operation' color='#ccc' />
    <Link to="/home">跳转 Home</Link>
    <div onClick={() => {
      const fn = setCount(true);
      console.log('nativeClick', { count }, fn)
    }} >
      <SvgIcon iconName='room' color='red' />
    </div>

    {/* <h1 onClick={() => {
      setCount(true);
      console.log(count)
    }}>
      111111111111
    </h1> */}
  </div>)

};

export default Demo;